// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.network.packets.hit;

import java.nio.ByteBuffer;
import zombie.core.network.ByteBufferWriter;
import zombie.core.raknet.UdpConnection;
import zombie.network.packets.INetworkPacket;

public abstract class Instance implements INetworkPacket {
    protected short ID;

    public void set(short _ID) {
        this.ID = _ID;
    }

    @Override
    public void parse(ByteBuffer b, UdpConnection connection) {
        this.ID = b.getShort();
    }

    @Override
    public void write(ByteBufferWriter b) {
        b.putShort(this.ID);
    }

    @Override
    public boolean isConsistent() {
        return this.ID != -1;
    }

    @Override
    public String getDescription() {
        return "ID=" + this.ID;
    }
}
